Add dependency header in default Cargo.toml
authorJohannes Hoff <johshoff@gmail.com>
Sun, 8 Nov 2015 03:36:06 +0000 (19:36 -0800)
committerJohannes Hoff <johshoff@gmail.com>
Sun, 8 Nov 2015 03:36:06 +0000 (19:36 -0800)
Almost any project beyond "hello world" will have some dependencies.
Including the `[dependencies]` header by default makes this slightly
simpler.

For new users of the language, this can potentially save some
frustration since crates.io currently does not mention the header, just
the line that goes beneath it.

For all users, this makes adding the first dependency to a project less
of a special case than to subsequent dependencies.

src/cargo/ops/cargo_new.rs

index c3a6e5acb555bebfd09f39bda642a401e2cc85f4..41f83186667e9a01c4017a23a8403cff633f0e0c 100644 (file)
@@ -147,6 +147,8 @@ r#"[package]
 name = "{}"
 version = "0.1.0"
 authors = [{}]
+
+[dependencies]
 "#, name, toml::Value::String(author)).as_bytes()));
 
     try!(fs::create_dir(&path.join("src")));